<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>瓜朋网Admin管理平台</title>
<link rel="stylesheet" type="text/css" href="/hdocs/admin/css/theme.css" />
<link rel="stylesheet" type="text/css" href="/hdocs/admin/css/style.css" />
<!--[if IE]>
<link rel="stylesheet" type="text/css" href="/hdocs/admin/css/ie-sucks.css" />
<![endif]-->
<script type="text/javascript" src="/hdocs/jquery/js/jquery-1.8.2.min.js"></script>
<script type="text/javascript" src="/hdocs/admin/js/common.js"></script>
<script type="text/javascript" src="/hdocs/admin/js/admin.js"></script>
<script type="text/javascript">
function fileBrowser() {
	$("#fileUpload").click();
}
function changeBrowser() {
	$("#viewFile").val($("#fileUpload").val());
}
function imageSubmit() {
	var title = $("#title").val();
	var introduction = $("#introduction").val();
	var imagename = $("#imagename").val();
	var subjectid = $("#subjectid").val();
	var content = $("#content").val();
	var label = $("#label").val();
	$("#update_title").val(title);
	$("#update_introduction").val(introduction);
	$("#update_imagename").val(imagename);
	$("#update_subjectid").val(subjectid);
	$("#update_content").val(content);
	$("#update_label").val(label);
	$("#uploadSubjectImageForm").submit();
}
</script>
</head>
<body onload="alertMsg('$!messageCodeMap.get($!messageCode)')">
	<div id="container">
		#set ($menuIndex="topic") #parse("/admin/inc/header.html")
		<div id="wrapper">
			<div id="content">
				<form id="uploadSubjectImageForm" action="/admin/topic/updateSubjectImages.jsp" style="display:none;" method="post" enctype="multipart/form-data">
					  <input id="fileUpload" type="file" onchange="changeBrowser()" name="fileUpload"/>
					  <input id="update_id" type="hidden" name="id" value="$!subject.id"/>
					  <input id="update_title" type="hidden" name="title" value="$!subject.title"/>
					  <input id="update_status" type="hidden" name="status" value="$!subject.status"/>
					  <input id="update_imagename" type="hidden" name="imagename" value="$!subject.imagename"/>
					  <input id="update_description" type="hidden" name="description" value="$!subject.description"/>
				</form>
				<form id="mainFrom" action="/admin/topic/subjectUpdate.jsp" method="post">
					<a href="/admin/topic/subjectList.jsp" class="aar">标题列表＞＞＞</a>
					<input type="hidden" id="id" name="id" value="$!subject.id" />
					<table>
						<caption>修改标题</caption>
						<tr>
							<th width="15%">主题名称</th>
							<td width="85%"><input type="text" id="title" name="title" size="80" value="$!subject.title" />
							</td>
						</tr>
						<tr>
							<th>状态</th>
							<td>
								<input type="radio" name="status" value="0" #if($!subject.status == 0) checked #end/>待发布&nbsp;&nbsp;
								<input type="radio" name="status" value="1" #if($!subject.status == 1) checked #end/>发布&nbsp;&nbsp;
								<input type="radio" name="status" value="-1" #if($!subject.status == -1) checked #end/>废弃
							</td>
						</tr>
						<tr>
							<th>图片</th>
							<td>
								<input id="viewFile" type="text" readonly style="width:300px; margin-right:30px;"/>
                        		<a href="javascript:fileBrowser();" style="margin-right:30px;">浏览本地照片</a>
                        		<a href="javascript:imageSubmit();">上传</a>
                        		#if($!subject.imagename)
			                    <p>
			                  		<img id="img3" src="$!article.images[1]"/>
			                  		<img id="img1" src="$!article.images[5]"/>
			                    </p>
			                    <input id="imagename" name="imagename" value="$!article.imagename" type="hidden"/>
							  #end 
							</td>
						</tr>
						<tr>
							<th>描述</th>
							<td>
								<textarea id="description" name="description" rows="5" cols="80">$!subject.description</textarea>
							</td>
						</tr>
						<tr>
							<td colspan="2">
								<input type="button" class="bt" onclick="updateSubject()" value="提交" />
								<input type="reset" class="bt" value="重置" />
								<span id="error" class="err"></span>
							</td>
						</tr>
					</table>
				</form>
			</div>
			#parse("/admin/inc/sidebar.html")
		</div>
		#parse("/admin/inc/footer.html")
	</div>
</body>
</html>

